package com.flushbonading.service.impl;

import com.flushbonading.pojo.RoleMenu;
import com.flushbonading.mapper.RoleMenuMapper;
import com.flushbonading.service.IRoleMenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zlx
 * @since 2021-04-07
 */
@Service
public class RoleMenuServiceImpl extends ServiceImpl<RoleMenuMapper, RoleMenu> implements IRoleMenuService {
    @Autowired
    private RoleMenuMapper roleMenuMapper;
    @Override
    public int insertRoleMenu(int role_id, List<Integer> menus) {
        int j = -1;
        int i = roleMenuMapper.deleteRoleMenuByID(role_id);
        if (i>=0)
            j = roleMenuMapper.insertRoleMenu(role_id,menus);
        return j;
    }
}
